<html>
<head><meta charset="utf-8"><title>When was `...` added to the language? · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/When.20was.20.60.2E.2E.2E.60.20added.20to.20the.20language.3F.html">When was `...` added to the language?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="210689693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/When%20was%20%60...%60%20added%20to%20the%20language%3F/near/210689693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/When.20was.20.60.2E.2E.2E.60.20added.20to.20the.20language.3F.html#210689693">(Sep 20 2020 at 23:02)</a>:</h4>
<p>I am currently trying to update the <a href="https://github.com/DanielKeep/tlborm">little book of rust macros</a> to bring it back to current rust and while going through the <a href="https://danielkeep.github.io/tlborm/book/pim-README.html">practical introduction</a> I noticed that the macro that is being build actually does NOT work anymore(assuming it ever did) due to it using <code>...</code> right after an expression fragment, which only allows <code>=&gt;</code> <code>,</code> <code>;</code>. I can't find when it was added, all I know is that its (probably only) use is the inclusive range which has been superceded by ..=.</p>



<a name="210691568"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/When%20was%20%60...%60%20added%20to%20the%20language%3F/near/210691568" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/When.20was.20.60.2E.2E.2E.60.20added.20to.20the.20language.3F.html#210691568">(Sep 20 2020 at 23:59)</a>:</h4>
<p><code>...</code> was stable in Rust 1.0:</p>
<div class="codehilite"><pre><span></span><code><span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">match</span><span class="w"> </span><span class="mi">42</span><span class="k">u8</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="mi">0</span><span class="o">..</span><span class="p">.</span><span class="mi">127</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{},</span><span class="w"></span>
<span class="w">        </span><span class="n">_</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{},</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>


<div class="codehilite"><pre><span></span><code>rustc +1.0.0 foo.rs
</code></pre></div>



<a name="210691893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/When%20was%20%60...%60%20added%20to%20the%20language%3F/near/210691893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Ellis O&#x27;Riley Jr. <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/When.20was.20.60.2E.2E.2E.60.20added.20to.20the.20language.3F.html#210691893">(Sep 21 2020 at 00:08)</a>:</h4>
<p>Jake, I’ve used ..</p>



<a name="210692041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/When%20was%20%60...%60%20added%20to%20the%20language%3F/near/210692041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/When.20was.20.60.2E.2E.2E.60.20added.20to.20the.20language.3F.html#210692041">(Sep 21 2020 at 00:12)</a>:</h4>
<p><span class="user-mention" data-user-id="344328">@Charles Ellis O'Riley Jr.</span> certainly, but they mean different things. <code>..</code> is an exclusive range, <code>...</code> is the (now-deprecated) syntax for an inclusive range. Modern Rust would write it as <code>..=</code>, but <code>...</code> was stabilized and needs to be supported more-or-less forever.</p>



<a name="210692587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/When%20was%20%60...%60%20added%20to%20the%20language%3F/near/210692587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/When.20was.20.60.2E.2E.2E.60.20added.20to.20the.20language.3F.html#210692587">(Sep 21 2020 at 00:25)</a>:</h4>
<p>Oh interesting so it was there from the "beginning" that probably explains why I couldn't find out when it was added. Just checked and it turns out that <code>...</code> after an expression fragment was allowed in the beginning, then got turned into a warning before being turned into a hard-error which is probably why the book had it working at first. I guess that part didn't age well. Thanks for the answer <span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>